home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
clue.lha
/
clue
/
doc
/
clue.tex
/
node119_mn.html
< prev
next >
Wrap
Text File
|
1989-07-12
|
5KB
|
136 lines
<H3><A ID="SECTION003511100000000000000"><tex2html_anchor_invisible_mark></A> <A ID="ch:actions"><tex2html_anchor_mark></A><BR>
Actions
</H3><#5004#>
<P>
An <#1378#><B>action</B><#1378#><A ID="1379"><tex2html_anchor_invisible_mark></A> is a function which is called to
process an input event received by a contact instance. An action function
accepts an argument list consisting of a contact instance and possibly
additional arguments.<A ID="1380"><tex2html_anchor_invisible_mark></A>
An action implements a response to
the given <#1381#><TT>event</TT><#1381#> which is performed by all instances of a contact class.
Actions are often generic functions with methods defined for
specific contact classes.
All responses of a CLUE application to its user input are occur via
actions. Typically, actions invoke contact callbacks<A ID="1382"><tex2html_anchor_invisible_mark></A> in
order to report the results of user input back to the application.
<P>
In general, an action represents a well-defined contact behavior that
might be done in response to <#1383#><EM>any</EM><#1383#> event. Contact programmers and
users can cooperate in defining how user events are bound to contact
actions (see Section~<A HREF=<tex2html_cr_mark>#ch:event-translation#1384><tex2html_cr_mark></A>). In some cases,
however, an action may be designed to handle a very specific event type.
The <#1385#><TT>with-event</TT><#1385#> macro can be used inside the body of an action in
order to access slots of the <#1386#><TT>event</TT><#1386#> which caused the action to be
called.
<P>
<#4281#><FONT SIZE="+1"><#1387#><B>with-event Macro</B><#1387#></FONT><#4281#>
<A ID="1388"><tex2html_anchor_invisible_mark></A>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9936#
</DIV>
<P>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9937#
</DIV>
<P>
The following actions are general utilities which are predefined by CLUE
for the basic <#1414#><TT>contact</TT><#1414#> class.<A ID="1415"><tex2html_anchor_invisible_mark></A>
<P>
<#4657#>
<#4284#><FONT SIZE="+1"><#1416#><B>perform-callback Action, contact</B><#1416#></FONT><#4284#>
<A ID="1417"><tex2html_anchor_invisible_mark></A>
<A ID="1418"><tex2html_anchor_invisible_mark></A>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9938#
</DIV><#4657#>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9941#
</DIV>
<P>
<#4658#>
<#4287#><FONT SIZE="+1"><#1429#><B>describe-action Action, contact</B><#1429#></FONT><#4287#>
<A ID="1430"><tex2html_anchor_invisible_mark></A>
<A ID="1431"><tex2html_anchor_invisible_mark></A>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9942#
</DIV><#4658#>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9945#
</DIV>
<P>
<#4659#>
<#4290#><FONT SIZE="+1"><#1445#><B>eval-action Action, contact</B><#1445#></FONT><#4290#>
<A ID="1446"><tex2html_anchor_invisible_mark></A>
<A ID="1447"><tex2html_anchor_invisible_mark></A>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9946#
</DIV><#4659#>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9949#
</DIV>
<P>
<#4660#>
<#4293#><FONT SIZE="+1"><#1462#><B>apply-action Action, contact</B><#1462#></FONT><#4293#>
<A ID="1463"><tex2html_anchor_invisible_mark></A>
<A ID="1464"><tex2html_anchor_invisible_mark></A>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9950#
</DIV><#4660#>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9953#
</DIV>
<P>
<#4661#>
<#4296#><FONT SIZE="+1"><#1479#><B>throw-action Action, contact</B><#1479#></FONT><#4296#>
<A ID="1480"><tex2html_anchor_invisible_mark></A>
<A ID="1481"><tex2html_anchor_invisible_mark></A>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9954#
</DIV><#4661#>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9957#
</DIV>
<P>
<#4662#>
<#4299#><FONT SIZE="+1"><#1493#><B>trace-action Action, contact</B><#1493#></FONT><#4299#>
<A ID="1494"><tex2html_anchor_invisible_mark></A>
<A ID="1495"><tex2html_anchor_invisible_mark></A>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9958#
</DIV><#4662#>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9961#
</DIV>
<P>
<#4663#>
<#4302#><FONT SIZE="+1"><#1510#><B>ignore-action Action, contact</B><#1510#></FONT><#4302#>
<A ID="1511"><tex2html_anchor_invisible_mark></A>
<A ID="1512"><tex2html_anchor_invisible_mark></A>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9962#
</DIV><#4663#>
<P>
<DIV class="RIGHT">
<tex2html_image_mark>#tex2html_wrap_inline9965#
</DIV>
<P>
=0 <#5014#>=0 <#5018#>